package com.dykj.fireFighting.api.base.bigdata.device.service;

import com.dykj.fireFighting.api.base.bigdata.device.entity.Device;
import com.dykj.fireFighting.api.base.bigdata.device.vo.DeviceVo;
import com.dykj.fireFighting.api.base.devHisResult.vo.ResultVo;
import com.dykj.fireFighting.common.core.service.IBaseService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 设备
 *
 * @Author fgc
 * @Date 2021-06-22 15:55:39
 */
public interface IDeviceService extends IBaseService<Device> {


    List<DeviceVo> deviceStatistics(HashMap<String, Object> params);

    /**
     * 高发设备类型统计
     *
     * @param unitId
     * @return
     */
    List<DeviceVo> queryFaultStatistical(String unitId);


    /**
     * 按类型查社会单位故障设备
     *
     * @param s 社会单位id
     * @return map
     */
    List<DeviceVo> selectByUnit(String s);

    /**
     * 按类型查监控中心所属故障设备
     *
     * @param ids 社会单位ids
     * @return map
     */
    List<DeviceVo> selectByCenter(List<String> ids);

    int countTotal(String s);

    int countFault(String s);

    int countCenterTotal(List<String> ids);

    int countCenterFault(List<String> ids);

    List<Device> getSelect(String s, String type);

    int countFaultByTime(String s, String beginTime, String endTime);

    Map<String, Double> faultEffectiveRecoveryRate(List<String> ids,String month);

    /**
     * 获取设备信息
     *
     * @param relationId
     * @return
     */
    Device getByRelationId(String relationId);


    Device getDeviceByRelationId(String relationId);

    /**
     * 改维保端调用社会端  复制到base，
     */
    Object getDevicedetails(String relationId);

    int getAllUnitByCount(List<String> ids, String begin, String end, Integer o);

    List<ResultVo> getDayByDate(String unitId, String beginTime, String endTime);

    List<ResultVo> getMonthByDate(String unitId, String beginTime, String endTime);

    List<ResultVo> getQuarterByDate(String unitId, String beginTime, String endTime);

    List<ResultVo> getYearByDate(String unitId, String beginTime, String endTime);

    List<ResultVo> getAllDay(List<String> ids, String beginTime, String endTime);

    List<ResultVo> getAllMonth(List<String> ids, String beginTime, String endTime);

    List<ResultVo> getAllQuarter(List<String> ids, String beginTime, String endTime);

    List<ResultVo> getAllYear(List<String> ids, String beginTime, String endTime);
}

